/* combi_pic.h */

#ifndef DODO_COMBI_PIC_H
#define DODO_COMBI_PIC_H

#include <dodo_plot/kernel/plotfwd.h>
#include <dodo_plot/kernel/basic_elements.h>
#include <dodo_plot/kernel/p_node.h>
#include <dodo_plot/kernel/picture.h>

namespace dodo_plot
{

class Combi_Pic : public P_Node
{
	friend Picture combi(const Picture& lower, const Picture& upper, 
		double x_offset, double y_offset);
	friend Picture combi(const Picture& lower, const Picture& upper, 
		int mode, 
		double extra_x_offset, double extra_y_offset);
	
	Combi_Pic(const Picture& lower, const Picture& upper, double x_offset, double y_offset);
	Combi_Pic(const Picture& lower, const Picture& upper, int mode = CENTER, double extra_x_offset = 0, double extra_y_offset = 0);

	double height() const;
	double width() const;
	Position local_pos() const;
	void draw(const Plotter& plotter) const;

	Point center_offset() const;
private:
	void set_offset(int mode, double extra_x_offset = 0, double extra_y_offset = 0);

	Picture l_, u_;
	Point offset_;

	enum Size_Lock
	{ NO_LOCK, LOCK_L, LOCK_U };

	Size_Lock size_lock_;
};

}
#endif //DODO_COMBI_PIC_H

